{% extends "tj3/tj3.html" %}


{% block content  %} 
<form action="." method="post" enctype="multipart/form-data">

<h2>Existing resource</h2>
<input type="submit" name="command" value="Update" class="button" /><br>

{% for r in resource_assigned %}
<table>
<tbody>
<tr>
	<td rowspan=2><input type="checkbox" name="{{r.id}}" value={{r.id}} checked>
	<td>Prime
	<td>
		<a href={% url resource_edit r.primary.id %}>
		{{r.primary.first_name|capfirst}} {{r.primary.last_name|capfirst}}
		</a>
	<td>{{r.primary.work_limit}}
<tr>
	<td>Alt.
	<td>
		<a href={% url resource_edit r.alternative.id %>
		{{r.alternative.first_name|capfirst}} {{r.alternative.last_name|capfirst}}
		</a>
	<td>{{r.alternative.work_limit}}
</tbody>
</table>
{% endfor %}

{% for r in resource_available %}
<table>
<tbody>
<tr>
	<td rowspan=2><input type="checkbox" name="{{r.id}}" value="{{r.id}}">
	<td>Prime
	<td>
		<a href={% url resource_edit r.primary.id %}>
		{{r.primary.first_name|capfirst}} {{r.primary.last_name|capfirst}}
		</a>
	<td>{{r.primary.work_limit}}
<tr>
	<td>Alt.
	<td>
		<a href={% url resource_edit r.alternative.id %>
		{{r.alternative.first_name|capfirst}} {{r.alternative.last_name|capfirst}}
		</a>
	<td>{{r.alternative.work_limit}}
</tbody>
</table>
{% endfor %}

<h2>Create new</h2>
<input type="submit" name="command" value="Create" class="button" /><br>
<!--- create a new alloc --->
<table>
	{{alloc_formset.management_form}}
	{{alloc_formset}}
</table>
</form>
{% endblock content %}
